package person.csx.meeting.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import person.csx.meeting.model.Meeting;
import person.csx.meeting.service.MeetingService;

import java.util.List;

@Controller
@RequestMapping("/Meeting")
public class MeetingController {
    @Autowired
    private MeetingService MeetingServiceImpl;

    @RequestMapping("list.do")
    public String listMeetings(Model model) {

        List<Meeting> meetings = MeetingServiceImpl.list();

        model.addAttribute("meetings", meetings);

        return "listMeetings";
    }

}
